<?php

namespace App\Library\Traits\Orm;

use App\Models\AreaModel;
use Illuminate\Database\Eloquent\Relations\HasMany;

trait AreaOrmTrait
{
    public function child(): HasMany
    {
        return $this->hasMany(AreaModel::class, 'parent_id', 'id')->select('id', 'parent_id', 'name', 'code');
    }
}
